Repository navigation
Conversation
cute.local_tile(t, (128, 64, 1), (m, n, None), proj=(1, 1, None)) on a rank-2 tensor, followed by cute_ext.copy from or to the tile, aborted the process during compilation without a diagnostic (NVIDIA#3957). For a flat proj over a tuple tiler and coord, drop the projected modes from the tiler and the coord in Python and emit the op without proj. It selects the same tile. Other forms of tiler/coord still pass proj to the op.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3957.
Problem
On a rank-2 tensor,
cute.local_tilewith a projection that drops a mode, followed bycute_ext.copyfrom or to the tile, aborts the process during compilation (pm.run), with no diagnostic:Reproduced on a B200 with
nvidia-cutlass-dsl4.9.0.dev1 using the script from the issue. What I found while narrowing it down:cute.local_tile(mA, (128, 64), (cta_m, cta_n))only in thecute.local_tileop: tile[128:1;64:1;1:0], coord(?,?,_)andproj = "(1,1,_)"instead of the two-mode tile and coord. The printed tile layout is the same,(128,64):(1,128).(1, 1, None)and(1, None, 1)abort,proj=(1, 1)compiles. Static or dynamic coord and a 1x1 or larger grid make no difference.cute_ext.copy:cute_ext.partitionalone, or indexed loads and stores on the tile, compile.(m, n, None, l)) compile.The abort itself is inside the compiler passes, which I cannot see, so this PR does not fix it there.
Change
local_tilenow applies a flat projection itself: it drops the projected modes from the tiler and from the coord (modes of the coord past the projection are kept) and emits the op withoutproj. This selects the same tile, and the emitted IR is the form that already works. Tilers or coords that are not plain tuples of the projection's rank still passprojto the op as before.If you would rather fix this in the pass and keep
projon the op, the test below may still be useful.Tests
New
test/python/CuTeDSL/test_local_tile_proj_copy.py: copies a (256, 128) tensor tile by tile throughcute_ext.copy, for rank 2 and 3, with no projection, an identity projection, and projections dropping the last and the middle mode. Each case runs in a subprocess, since the regression kills the process.PASS.(1, None, 1),(None, 1, 1),(1, 1, None)with coord(m, n, None, l), as in the dense GEMM examples) address the same elements before and after the change.